package com.enjoyor.soa.traffic.server.tpcms.dubbo.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.enjoyor.soa.traffic.api.dto.tpcms.PassCheckDto;
import com.enjoyor.soa.traffic.api.service.dubbo.tpcms.IDubboPassCheckService;
import com.enjoyor.soa.traffic.core.tpcms.service.IPassCheckService;
import com.enjoyor.soa.traffic.util.pojo.Page;
import com.enjoyor.soa.traffic.util.pojo.ResultPojo;

@Service(version = "1.0.0", timeout = 4000)
public class DubboPassCheckService implements IDubboPassCheckService {

    @Autowired
    private IPassCheckService passCheckService;

    /**
     * 申请单审核
     */
    @Override
    public ResultPojo insertPassCheck(PassCheckDto passCheckDto, String userName) {
        return new ResultPojo(passCheckService.insertPassCheck(passCheckDto, userName));
    }

    /**
     * 查询审核记录列表信息
     */
    @Override
    public ResultPojo getPassCheckList(String checkId, String passApplyId, String checkPersonId, String checkDeptId,
            String checkStartTime, String checkEndTime, String checkStatusId, String isDelete) {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("checkId", checkId);
        map.put("passApplyId", passApplyId);
        map.put("checkPersonId", checkPersonId);
        map.put("checkDeptId", checkDeptId);
        map.put("checkStartTime", checkStartTime);
        map.put("checkEndTime", checkEndTime);
        map.put("checkStatusId", checkStatusId);
        map.put("isDelete", isDelete);
        return new ResultPojo(passCheckService.getPassCheckList(map));
    }

    /**
     * 查询申请单分页信息-审核
     */
    @SuppressWarnings("rawtypes")
    @Override
    public ResultPojo getPassApplyCheckPage(Page page) {
        return new ResultPojo(passCheckService.getPassApplyCheckPage(page));
    }

}
